<?php
	include_once 'autoload.php';
	

	session_start();

	$ctl = new ChownPassCtl();
	$ctl->checkLogged();
	$ctl->checkNotReadonly();
	$ctl->proceed();
	
	$header = new Header();
	$header->render('Change Own Password');


	$form = $ctl->getChownPassForm();
	
	$old = $form->getOld();
	$pass = $form->getPass();
	$repeat = $form->getRepeat();
	$readonly = $form->isReadonly();
	
	$check = HtmlUtil::getCheckbox('readonly', 'on', $readonly, array());
?>
<form method="post">
<input type="hidden" name="pagename" value="chownpass" id="pgid">
<input type="hidden" name="metname" value="" id="metid">

<h2>Change Own Password</h2>
<p>Please provide the information below, then click "Submit"</p>

<table cellpadding="4" cellspacing="0" class="list">
	<tr>
		<td>Old Password:</td>
		<td><input type="password" name="old" value="<?php echo $old; ?>"></td>
	</tr>
	<tr>
		<td>New Password:</td>
		<td><input type="password" name="pass" value="<?php echo $pass; ?>"></td>
	</tr>
	<tr>
		<td>Repeat:</td>
		<td><input type="password" name="repeat" value="<?php echo $repeat; ?>"></td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td><?php echo $check; ?> Readonly</td>
	</tr>
	<tr>
		<td>&nbsp;</td>
		<td>
			<input type="button" value="Submit" onclick="triggerform('submit')" class="enter"> 
			<input type="button" value="Cancel" onclick="triggerform('cancel')" class="escape">
		</td>
	</tr>
</table>
</form>
<?php
	$footer = new Footer();
	$footer->render();
?>
